
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;

int test(vector<string> &str, const string &find_str) {
    set<string> tmp = {"apple", "banana"};
    str.erase(std::remove_if(str.begin(), str.end(),
                             //                             [find_str](const string &n) { return n == find_str; }), str.end());
                             [&](const string &n) { return tmp.find(n) != tmp.end(); }),
              str.end());
    vector<string>::iterator iter;

    cout << "test: " << endl;
    for (iter = str.begin(); iter != str.end(); ++iter) {
        cout << *iter << " ";
    }
    cout << endl;
    return 0;
}

int main() {
    vector<string> str = {"apple", "banana", "banana", "key", "cat", "dog", "orange", "banana", "cat"};
    auto find_str = "cat";
    auto sd = remove_if(str.begin(), str.end(), [find_str](const string &n) { return n == find_str; });
    str.erase(sd);
    for (const auto &s : str) {
        cout << s << " ";
    }
    cout << endl;
    //    test(str, "orange");
    test(str, "cat");
    cout << "test: " << endl;
    for (const auto &s : str) {
        cout << s << " ";
    }
    cout << endl;

    int test = {};
    cout << test << endl;
    return 0;
}